<?php

/**
 * @author shuang
 * @date 2016-11-4 9:24:58
 */
use yii\helpers\Url;
use yii\bootstrap\Html;
use common\components\MTools;

$this->registerCssFile('/css/task.css', ['depends' => ['frontendx\assets\AppAsset']]);
$this->registerCssFile('/css/zoomify.min.css', ['depends' => ['frontendx\assets\AppAsset']]);
?>
<div class="task-outline">
    <div class="title-block">
        <span><?php echo $taskmodel['title']; ?></span>
        <i></i>
        <small><?php echo $taskmodel['brush_price']; ?> 币</small>
        <p>剩余数量：<?php echo $taskmodel['number'] - $taskmodel['taskcount']; ?></p>
        <div class="complete-seal-icon"></div>
    </div>
    <div class="outline">
        <span><?php echo $typename; ?></span>
        <span>12小时内审核</span>
        <span><?php echo $taskmodel['areaname']; ?></span>
        <span><?php echo Yii::$app->formatter->asDate($taskmodel['created_at']); ?></span>
    </div>
</div>
<?php if ($taskmodel['step']): $stepdata = \yii\helpers\Json::decode($taskmodel['step']); ?>
    <div class="task-step">
        <div class="title">任务步骤</div>
        <?php foreach ($stepdata as $key => $item): ?>
            <div class="group">
                <div class="min-title"><i class="stepscript"></i>第<?php echo $key + 1; ?>步：</div>
                <div class="text <?php echo count($stepdata) == ($key + 1) ? "complete" : ""; ?>">
                    <?php echo $item['step']; ?>
                    <?php if ($item['stepfile']): $arr_stepfile = explode(",", $item['stepfile']) ?>
                        <div class="image">
                            <?php foreach ($arr_stepfile as $val): ?>
                                <img src="<?php echo MTools::Qiniunow480($val); ?>" alt=""/>
                            <?php endforeach; ?>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
<?php endif; ?>
<?php if ($taskmodel['vote_address']): ?>
    <div class="out-link">
        <i></i>
        <span>任务链接</span>
        <small><a href="<?php echo $taskmodel['vote_address']; ?>">点击打开链接</a></small>
    </div>
<?php endif; ?>
<div class="task-careful">
    <div class="title">注意事项</div>
    <div class="text">
        <p><?php echo $areaType['considerations']; ?></p>
    </div>
</div>
<div class="task-detail-footer fixed">
    <div class="left"><a href="<?php echo Url::toRoute(["article/contact"]); ?>">
            <i></i>
            <span>官方交流群</span>
        </a>
    </div>
    <div class="right blue btn-validatetask" url="<?php echo \yii\helpers\Url::toRoute(["task/validatetask", "taskid" => $taskmodel["id"], "tasknum" => \common\components\MTools::IntFormat($taskmodel["number"] - $taskmodel["taskcount"])]); ?>">领取任务</div>
</div>
<div class="more">
    <div class="photo">
        <div class="title">示例图照片</div>
        <div class="content">
            <?php echo $this->render("task_image", ["images" => $taskmodel['sample_figure']]); ?>
        </div>
    </div>
</div>